Ext.define("App.datasource.view.DataTableList", {
    extend: "Extend.grid.CrudGridPanel",
    alias: 'widget.DataTableList',
    requires: ['App.datasource.model.DataTableViewModel'],
    viewModel: 'DataTableViewModel',
    config: {
        tbar: {
            quickCreate: {
                hidden: true
            }
        }
    },
    bind: {
        store: '{Query}',
        columns: '{columns}',
        search: '{search}'
    },
    editor: {
        formClass: 'App.datasource.view.DataTableEditor',
        model: 'App.datasource.model.DataTableModel',
        save: 'data_table/save',
        get: 'data_table/get_by_id',
        del: 'data_table/deletes'
    },
    deleteHandler: function (ids, messages) {
        var me = this;
        Extend.Msg.confirm('确认', '请确定您是否要删除选择的数据，删除数据时将删除字段配置的数据', '如果被指标配置引用，将不能删除！',
            function (opt) {
                if (opt === 'yes') {
                    me.doDelete(ids);
                }
            })
    }
});